; *** English, Solitaire
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com
(translate
 ("Latin Cross" "第1关：拉丁十字") ("Greek Cross" "第2关：希腊十字") ("Large Cross" "第3关：大十字")
 ("Fireplace" "第4关：壁炉") ("Diamond" "第5关：钻石")
 ("Tiny Pyramid" "第6关：小金字塔") ("Pyramid" "第7关：大金字塔")
 ("Altar" "第8关：祭坛") ("Lamp" "第9关：灯塔")
 ("Arrowhead" "第10关：箭头") ("Inclined Square" "第11关：斜方形")
 ("Crossbow" "发射-十字弓") ("Longbow" "发射-长弓")
 ("Standard" "英国独立钻石-标准") ("Wall" "英国独立钻石-外围")
 ("Square" "英国独立钻石-方格") ("Pinwheel" "英国独立钻石-风车")
 ("Tutorial #1 -- Slice (Three-Removal)" "基本教程1-4子吃法")
 ("Tutorial #2 -- Block Removal" "基本教程2-片吃手法")
 ("Tutorial #3 -- Elbow (L-Removal)" "基本教程3-L字吃法")
 ("Super Solitaire" "大型独立钻石")
)
(define jump ($1 (verify not-empty?) capture $1 (verify empty?) add))
(define win-leaving-at
	(win-condition (Player)
        ( and (pieces-remaining 1 Marble) (absolute-config Marble ($1)) )
    )
)
(define board-defs
        (grid
            (start-rectangle 1 1 29 29) ; top-left position
            (dimensions ;7x7
                ("a/b/c/d/e/f/g" (30 0)) ; columns
                ("7/6/5/4/3/2/1" (0 30)) ; rows
			)
			(directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
		)
        (kill-positions a1 a2 b1 b2 a6 a7 b6 b7 f1 f2 g1 g2 f6 f7 g6 g7)
)
(define standard-setup
    (board-setup
        (Player (Marble
                              c7 d7 e7
                              c6 d6 e6
                        a5 b5 c5 d5 e5 f5 g5
                        a4 b4 c4    e4 f4 g4
                        a3 b3 c3 d3 e3 f3 g3
                              c2 d2 e2
                              c1 d1 e1
		))
	)
)

(game
    (title "Latin Cross")
    (solution "Solutions\Solitaire,_English\Latin_Cross.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子，且位于棋盘中心")
    (history "Not quite as old as its French cousin, the 33-hole `English` board
       showed up in Germany before it ever made it to England.  J.C. Wiegleb wrote
       about it in 1779.\\
       Solitaire is also known as `Peg Solitaire` because it is sometimes
       played with pegs instead of marbles.   In England, `solitaire` usually
       refers to peg solitaire, while solo card games are referred to as patience.")
    (strategy "Clear out areas and work towards your finishing point.  Try
       not to let a marble become stranded all by itself.  If you
       already have a stranded marble.  Try to plot its rescue!\\
       It helps to learn a few basic removal patterns: rows of three,
       2x3 blocks, and L-shapes (see the three Tutorial problems).   The most complete
       book on all forms of peg solitaire is John D. Beasley's `The Ins & Outs of Peg
       Solitaire`.  See the Zillions web site at
       http://www.zillions-of-games.com/solitaire.html for other suggested books.\\
       To see the solution, select 'Show Solution' under the Help menu.")
    (option "prevent flipping" 2)
    (move-sound "")
	(capture-sound "Audio\\Clack.wav")
	(players Player)
    (turn-order Player)
    (piece
        (image Player "images\Solitaire\Marble.bmp")
        (name Marble)
		(help "横向或纵向跳过一个相邻子并吃掉之。")
		(moves
			(jump n)
			(jump e)
			(jump s)
			(jump w)
		)			
	)
    (board
        (image "images\Solitaire\Englishd4.bmp")
		(board-defs)
	)

    (board-setup (Player (Marble d3 d4 c5 d5 e5 d6)))
	(win-leaving-at d4)
    (loss-condition (Player) stalemated)
)

(variant
    (title "Greek Cross")
    (solution "Solutions\Solitaire,_English\Greek_Cross.zsg")
    (board-setup (Player (Marble d2 d3 b4 c4 d4 e4 f4 d5 d6)))
)

(variant
    (title "Large Cross")
	(solution "Solutions\Solitaire,_English\Large_Cross.zsg")
    (board-setup
        (Player (Marble
                           d7
						   d6
                        c5 d5 e5
                  a4 b4 c4    e4 f4 g4
				        c3 d3 e3
						   d2
						   d1
		))
	)
)

(variant
    (title "Fireplace")
    (solution "Solutions\Solitaire,_English\Fireplace.zsg")
    (board-setup (Player (Marble c4 c5 c6 c7 d5 d6 d7 e4 e5 e6 e7)))
)

(variant
    (title "Diamond")
    (solution "Solutions\Solitaire,_English\Diamond.zsg")
    (board-setup (Player (Marble d2 c3 d3 e3 b4 c4 e4 f4 c5 d5 e5 d6)))
)

(variant
    (title "Tiny Pyramid")
	(solution "Solutions\Solitaire,_English\Tiny_Pyramid.zsg")
    (board-setup (Player (Marble b3 c3 d3 e3 f3 c4 d4 e4 d5)))
)

(variant
    (title "Pyramid")
	(solution "Solutions\Solitaire,_English\Pyramid.zsg")
    (board-setup (Player (Marble a3 b3 c3 d3 e3 f3 g3 b4 c4 d4 e4 f4 c5 d5 e5 d6)))
)

(variant
    (title "Altar")
    (solution "Solutions\Solitaire,_English\Altar.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子，且位于标记处（棋盘中心上方一格）")
    (option "prevent flipping" true)
    (board
        (image "images\Solitaire\Englishd5.bmp")
		(board-defs)
	)
    (board-setup (Player (Marble c1 d1 e1 c2 d2 e2 d3 d4 b5 c5 d5 e5 f5 d6 d7)))
	(win-leaving-at d5)
    (loss-condition (Player) stalemated)
)

(variant
    (title "Lamp")
	(solution "Solutions\Solitaire,_English\Lamp.zsg")
    (board-setup (Player (Marble c1 d1 e1 c2 d2 e2 d3 d4 b5 c5 d5 e5 f5 c6 d6 e6 d7)))
)

(variant
    (title "Arrowhead")
	(solution "Solutions\Solitaire,_English\Arrowhead.zsg")
    (board-setup
        (Player (Marble
                           d6    
                        c5 d5 e5
                     b4          f4
                  a3       d3       g3
                        c2 d2 e2
                        c1 d1 e1
		))
	)
)

(variant
    (title "Inclined Square")
	(solution "Solutions\Solitaire,_English\Inclined_Square.zsg")
    (board-setup (Player
       (Marble d1 c2 d2 e2 b3 c3 d3 e3 f3 a4 b4 c4 e4 f4 g4 b5 c5 d5 e5 f5 c6 d6 e6 d7)
    ))
)

(variant (title "-")) ;------------------------------------------------------

(variant
    (title "Crossbow")
    (solution "Solutions\Solitaire,_English\Crossbow.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子，且位于棋盘标记位置（棋格背景颜色灰色）")
    (option "prevent flipping" true)
    (board
        (image "images\Solitaire\Englishd7.bmp")
		(board-defs)
	)
    (board-setup (Player (Marble d2 b3 c3 d3 e3 f3 b4 c4 e4 f4)))
    (win-condition (Player) (absolute-config Marble (d7)))
    (loss-condition (Player) stalemated)
)

(variant
    (title "Longbow")
    (solution "Solutions\Solitaire,_English\Longbow.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子，且位于棋盘标记位置（棋格背景颜色灰色）")
    (option "prevent flipping" true)
    (board
        (image "images\Solitaire\Englishd7.bmp")
		(board-defs)
	)
    (board-setup (Player (Marble a4 a5 b3 b4 c2 d1 d2 d3 d4 e2 f3 f4 g4 g5)))
    (win-condition (Player) (absolute-config Marble (d7)))
    (loss-condition (Player) stalemated)
)

(variant (title "-")) ;------------------------------------------------------

(variant
    (title "Standard")
	(solution "Solutions\Solitaire,_English\Standard.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子，且位于棋盘中心")
    (history "This is the most popular problem on the English board.   The
      initial vacant hole can be placed anywhere on the board (using the Setup
      menu: right-click with the mouse), and the last man can always be left
      in that hole.\\
      The first complete set of solutions to the single-vacancy problems was
      probably worked out in 1841-1842 by Antoine Suremain de Missery.
      The shortest solution to this problem, 18 moves, was discovered in 1912 by
      Ernest Bergholt, beating Dudeney's 1908 solution by one move (a series of
      consecutive jumps by one marble counts as a single move.")
	(standard-setup)
)

(variant
    (title "Wall")
	(solution "Solutions\Solitaire,_English\Wall.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：所有棋子恰好全部占领棋盘边角，不多不少")
    (board
        (image "images\Solitaire\EnglishWall.bmp")
		(board-defs)
	)
	(standard-setup)
    (win-condition (Player)
       (and
         (pieces-remaining 24 Marble)
         (absolute-config Marble (
                 c7 d7 e7
                 c6    e6
           a5 b5 c5    e5 f5 g5
           a4                g4
           a3 b3 c3    e3 f3 g3
                 c2    e2
                 c1 d1 e1 
         )) 
       ) 
    )
    (loss-condition (Player) stalemated)
)

(variant
    (title "Square")
	(solution "Solutions\Solitaire,_English\Square.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：余下8个棋子，且恰好围着棋盘中心一圈")
    (board
        (image "images\Solitaire\EnglishSquare.bmp")
		(board-defs)
	)
	(standard-setup)
    (win-condition (Player)
      (and
        (pieces-remaining 8 Marble)
        (absolute-config Marble (
             c5 d5 e5
             c4    e4
             c3 d3 e3
        ))
      )
    )
    (loss-condition (Player) stalemated)
)

(variant
    (title "Pinwheel")
    (solution "Solutions\Solitaire,_English\Pinwheel.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下12个棋子，且全部位于棋盘标记位置（棋格背景颜色灰色），摆成一个“风车”型。")
    (option "prevent flipping" true)
    (board
        (image "images\Solitaire\EnglishPinwheel.bmp")
		(board-defs)
	)
	(standard-setup)
    (win-condition (Player)
      (and
        (pieces-remaining 12 Marble)
        (absolute-config Marble (
                       e7
                    d6
           a5    c5    e5
              b4          f4
                 c3    e3    g3
                    d2
                 c1
        ))
      )
    )
    (loss-condition (Player) stalemated)
)

(variant (title "-")) ;------------------------------------------------------

(variant
    (title "Tutorial #1 -- Slice (Three-Removal)")
	(solution "Solutions\Solitaire,_English\Tutorial1.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子")
    (strategy "Three marbles in a row can be removed if there is another marble
       (a `catalyst`) next to either end, with an empty hole on the other side
       of the catalyst.   This is the simplest removal pattern, 
       but it is part of an easy solution to every single-vacancy problem on the
       English board.  See `Winning Ways` by Berlekamp, Conway, and Guy (volume 2,
       page 704) for more details.\\
       To see the solution, select `Show Solution` under the Help menu.  Click
       on the Back to Start button (<<) and then go forward one move at a time
       (>) to see the solution step-by-step.")
    (board
       (image "images\Solitaire\English.bmp")
	   (board-defs)
	)
    (board-setup (Player (Marble e2 e3 e4 f4)))
	(win-condition (Player) (pieces-remaining 1 Marble) )
    (loss-condition (Player) stalemated)
)

(variant
    (title "Tutorial #2 -- Block Removal")
	(solution "Solutions\Solitaire,_English\Tutorial2.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子")
    (strategy "This is one of the most useful removal patterns.  Learn this and
       you are well on your way to solving most of the single-vacancy problems on
       the English board.\\
       To see the solution, select `Show Solution` under the Help menu.")
    (board
       (image "images\Solitaire\English.bmp")
		(board-defs)
	)
    (board-setup (Player (Marble b3 c1 d1 e1 c2 d2 e2)))
	(win-condition (Player) (pieces-remaining 1 Marble) )
    (loss-condition (Player) stalemated)
)

(variant
    (title "Tutorial #3 -- Elbow (L-Removal)")
	(solution "Solutions\Solitaire,_English\Tutorial3.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子")
    (strategy "This is another removal pattern, useful in many of the single-vacancy
       problems on the English board.   A simple solution to the Standard problem
       (also called Central Solitaire) has this configuration near the end.\\
       To see the solution, select `Show Solution` under the Help menu.")
    (board
       (image "images\Solitaire\English.bmp")
	   (board-defs)
	)
    (board-setup (Player (Marble c1 d1 e1 c2 c3 c4 d3)))
	(win-condition (Player) (pieces-remaining 1 Marble) )
    (loss-condition (Player) stalemated)
)

(variant (title "-")) ;------------------------------------------------------

(variant
   (title "Super Solitaire")
   (solution "Solutions\Solitaire,_English\Super.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子，且位于棋盘中心")
   (history "The 45-hole board first appeared in a German book by J.C. Wiegleb
       in 1779.  It is quite a bit more difficult than the standard English
       board, although an empty hole can be placed almost anywhere and it
       will still be possible to finish with a peg there.")
   (board
       (image "images\Solitaire\SuperSolitaire.bmp" "images\Solitaire\SuperSolitaire2.bmp")
       (grid
          (start-rectangle 1 1 29 29) ; top-left position
          (dimensions ;9x9
            ("a/b/c/d/e/f/g/h/i" (30 0)) ; columns
            ("9/8/7/6/5/4/3/2/1" (0 30)) ; rows
          )
          (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
       )
       (kill-positions a1 a2 a3 a7 a8 a9 b1 b2 b3 b7 b8 b9 c1 c2 c3 c7 c8 c9
                       g1 g2 g3 g7 g8 g9 h1 h2 h3 h7 h8 h9 i1 i2 i3 i7 i8 i9)
    )
    (board-setup
        (Player (Marble
                 d9 e9 f9
                 d8 e8 f8
                 d7 e7 f7
        a6 b6 c6 d6 e6 f6 g6 h6 i6
        a5 b5 c5 d5    f5 g5 h5 i5
        a4 b4 c4 d4 e4 f4 g4 h4 i4
                 d3 e3 f3
                 d2 e2 f2
                 d1 e1 f1
        ))
   )
   (win-leaving-at e5)
   (loss-condition (Player) stalemated)
)




